import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import './assets/global.css'
import './assets/fonts/iconfont.css'

//富文本编辑器组件
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
const options = {}; /* { default global options } */
Vue.use(VueQuillEditor, options); // options可选


//数据统计组件
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts

//商品分类组件
import TreeTable from 'vue-table-with-tree-grid'
Vue.component('tree-table',TreeTable)

//element-ui组件
import ElementUI, { Message, MessageBox } from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

//导入过滤器
import http from './utils/Request'
Vue.prototype.$http=http
// baseURL:"http://127.0.0.1:8888"
//提示框
Vue.prototype.$message=Message
Vue.config.productionTip = false

// 自定义格式化时间的全局过滤器
Vue.filter('dateFormat',function(originVal){
  const dt =new Date(originVal)

  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2,'0')
  const d = (dt.getDate() +'').padStart(2,'0')
  //padStart(2,'0') 意思是不足两位自动补0
  const hh = (dt.getHours() + '').padStart(2,'0')
  const mm = (dt.getMinutes() + '').padStart(2,'0')
  const ss = (dt.getSeconds() + '').padStart(2,'0')
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
